package com.glory.huaweipda.model

import android.util.Log
import com.glory.huaweipda.bean.HeaderBean
import com.glory.huaweipda.bean.NetRequestBean
import com.google.gson.Gson
import com.google.gson.JsonObject
import org.apache.commons.lang3.StringEscapeUtils

/**
 * @author HX
 * @date 2021/4/21
 * @desc
 */
open class BaseRepository {
    protected fun getInJsonData(map: JsonObject, messageName: String): Map<String,String> {
        val format: NetRequestBean<*> = NetRequestBean<Any>()
        format.body =map
        format.header = HeaderBean(messageName)
        val map = hashMapOf<String,String>()
        map.put("",StringEscapeUtils.unescapeJson(Gson().toJson(format)))
        Log.e("请求JSON", "getInJsonData: " + StringEscapeUtils.unescapeJson(Gson().toJson(format)))
        return map
    }

}